var local="http://47.104.10.151";

function resmsg() {
    var keyId=getCookie('userId');
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt="";
    var page=0;
    txt="user_id="+keyId+"&page="+page;
    var url=local+":8080/messageController/findMessage";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            var result = xmlHttp.responseText;
            var json = eval("(" + result + ")");
            document.getElementById("input1").value=json.data.content[0].mesg;
            document.getElementById("input2").value=json.data.content[1].mesg;
            document.getElementById("input3").value=json.data.content[2].mesg;
            document.getElementById("input4").value=json.data.content[3].mesg;
            document.getElementById("input5").value=json.data.content[4].mesg;

        }
    }
}
function getCookie(c_name)
{
    if (document.cookie.length>0)
    {
        c_start=document.cookie.indexOf(c_name + "=")
        if (c_start!=-1)
        {
            c_start=c_start + c_name.length+1
            c_end=document.cookie.indexOf(";",c_start)
            if (c_end==-1) c_end=document.cookie.length
            return unescape(document.cookie.substring(c_start,c_end))
        }
    }
    return ""
}